<template>
	<view class="my-search-container" :style="{'background-color':bgcolor}" @click="searchBoxHandle">
		<view class="my-search-box" :style="{'border-radius':redius + 'px' }">
			<uni-icons type="search" size="18"></uni-icons>
			<text class="placeholder">搜索</text>
		</view>
	</view>
</template>

<script>
	export default {
		props: {
			bgcolor: {
				type: String,
				default: '#ffd242'
			},
			redius: {
				type: Number,
				default: 18
			}
		},
		methods: {
			searchBoxHandle() {
				this.$emit('click')
			}
		}
	}
</script>

<style lang="scss" scoped>
	.my-search-container {
		display: flex;
		justify-content: center;
		align-items: center;
		height: 40px;
		width: 100%;

		.my-search-box {
			height: 30px;
			background-color: white;
			width: 95vw;
			display: flex;
			justify-content: center;
			align-items: center;

			.placeholder {
				margin-left: 5px;
			}
		}
	}
</style>
